##server.py
from socket import *
import simplejson as json
import logging
from Queue import Queue 

HOST = ''
PORT = 29876
ADDR = (HOST,PORT)
BUFSIZE = 4096
 
serv = socket( AF_INET,SOCK_STREAM)    
 
##bind our socket to the address
serv.bind((ADDR))
serv.listen(5)

logging.info('Starting up on %s port %s' % ADDR)

while True:
  # wait for somethin in the queue
    conn,addr = serv.accept()
    print addr
    logging.info('Client connected') 
    data = dict()
    data = {"message": "new connection"}
    conn.send(json.dumps(data))
    conn.close()
